#include "Achievement.h"

Achievement::Achievement() : m_closed(false)
{
}


const QString& Achievement::name() const
{
    return m_name;
}

void Achievement::setName(QString &name)
{
    m_name = name;
}

const QString& Achievement::iconUrl() const
{
    return m_iconUrl;
}

void Achievement::setIconUrl(const QString &iconUrl)
{
    m_iconUrl = iconUrl;
}

bool Achievement::closed() const
{
    return m_closed;
}

void Achievement::setClosed(bool closed)
{
    m_closed = closed;
}

const QString& Achievement::description() const
{
    return m_desc;
}

void Achievement::setDescription(const QString &desc)
{
    m_desc = desc;
}

QDataStream &operator<<(QDataStream &out, const Achievement& achievement)
{

//    if (achievement.name() == "FORE!" || achievement.name() == "BRIDGE BURNER" )
//    {
//        out << achievement.name() << achievement.iconUrl()
//                << false;
//        return out;
//    }

    out << achievement.name() << achievement.iconUrl()
            << achievement.closed();
    return out;
}

QDataStream &operator>>(QDataStream &in, Achievement& achievement)
{
    QString name;
    QString iconUrl;
    bool closed;

    in >> name >> iconUrl >> closed;

    achievement.setName(name);
    achievement.setIconUrl(iconUrl);
    achievement.setClosed(closed);

    return in;

}

